package com.power.sifa.base.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.annotations.FieldEnumText;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  队列消费错误记录实体类
*/

@Entity
@ApiModel(value="队列消费错误记录")
@Data
@Table(name="Mq_logerr",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Mq_logerr.Mq_logerrPK.class) 用于复合组件
public class Mq_logerr extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "序号")
    private String id;

    @ApiModelProperty(value = "队列名")
    private String mqname;

    @ApiModelProperty(value = "数据")
    private String mqdata;

    @ApiModelProperty(value = "发生时间", example="2020-10-22 10:03:22")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date exectime;

    @ApiModelProperty(value = "错误信息")
    private String errormsg;

    @ApiModelProperty(value = "来源")
    private String source;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("mqname", this.getMqname());
        map.put("mqdata", this.getMqdata());
        map.put("exectime", this.getExectime());
        map.put("errormsg", this.getErrormsg());
        map.put("source", this.getSource());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Mq_logerrPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String) key;
        //Mq_logerrPK pk = (Mq_logerrPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}
